CFLAGS= -g -std=gnu99
CFLAGS += -I./ 
CC=gcc
LIB_OBJS = mln_redis_cache.o mln_redis_database.o redisconn.o 

LDFLAGS += -lhiredis -lssl -lcrypto 
DEPDIR = .deps
LIB_TARGET = libmlnredis.a

all :	$(DEPDIR) $(LIB_TARGET) 

$(DEPDIR):
	+@[ -d $@ ] || mkdir -p $@


$(LIB_TARGET): $(LIB_OBJS)
	ar rc $@ $^
	ranlib $@

%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@ -MD -MF $(DEPDIR)/$(<:.c=.d)

clean:
	rm -rf *.o $(DEPDIR) $(LIB_TARGET) 

-include $(DEPDIR)/*.d

